package com.ruibo.tax.repository;


import com.ruibo.tax.model.log.TaxSendLog;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import javax.transaction.Transactional;
import java.util.List;

/**
 * @author 孙峰
 * @Description: TODO
 * @date 2020/12/22 19:28
 */
public interface TaxSendLogRepository extends JpaRepository<TaxSendLog, Integer> {

    /**
     * @param sendStatus
     * @param pkgNum
     * @param pkgType
     */
    @Modifying
    @Transactional
    @Query(value = "update t_tax_send_log  set send_status=?1 where pkg_num=?2 and pkg_type=?3 ", nativeQuery = true)
    void updateSendStatusByAndPkg_numAndPkg_type(int sendStatus, String pkgNum, String pkgType);


    List<TaxSendLog> findAllBySendStatusAndTimesLessThan(Integer sendStatus, Integer times);

}
